package grpc

import (
	"context"
	"jihe.common/protos/user_server/proto"
	"user_server/internal/models/c_d_user"
)

func (s *Server) UserCreateCDUser(c context.Context,in *proto.UserCDUser) (ret *proto.UserNull,err error) {
	ret = new(proto.UserNull)
	cDUserTbl := c_d_user.NewModel(s.Pgsql.Get())
	_,err = cDUserTbl.Create(in)
	return
}

func (s *Server) UserGetCDUsersByDUid(c context.Context,in *proto.UserCDUser) (ret *proto.UserGetCDUsersByDUidRes,err error) {
	cDUserTbl := c_d_user.NewModel(s.Pgsql.Get())
	return cDUserTbl.GetCUidsByDUid(in)
}
